package com.ken.android.music.view.fragment;

import android.content.Context;
import android.support.v4.media.session.MediaControllerCompat;

import com.ken.android.music.mvp.B.BaseFragment;
import com.ken.android.music.mvp.B.BasePresenter;
import com.ken.android.music.mvp.B.I.IBaseView;
import com.ken.android.music.view.activity.BaseAudioActivity;

public abstract class BaseAudioFragment<V extends IBaseView,P extends BasePresenter<V>> extends BaseFragment<V,P> {


    MediaControllerCompat controllerCompat;
    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        if(context != null){
            if(context instanceof BaseAudioActivity){
                controllerCompat = ((BaseAudioActivity)context).getControllerCompat();
            }
        }
    }

    @Override
    public void onDetach() {
        super.onDetach();
        controllerCompat = null;
    }
}
